import { requestDetailList } from '@/api'


const state = {
  detailList: {}
}
const mutations = {
  SET_DETAILLIST_STATE(state, value) {
    state.detailList = value
  }
}
const actions = {
  async getDetailList({ commit }, skuId) {
    const re = await requestDetailList(skuId)
    commit('SET_DETAILLIST_STATE', re)
  }
}
const getters = {
  categoryView(state) {
    return state.detailList.categoryView || {}
  },
  skuInfo(state) {
    return state.detailList.skuInfo || {}
  },
  spuSaleAttrList(state) {
    return state.detailList.spuSaleAttrList ||[]
  }
}
export default {
  namespaced: true,
  state,
  actions,
  mutations,
  getters
}


